<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>添加用户 - H-ui.admin v3.1</title>
<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
	<form action="/goUser" method="post" onsubmit="return checkUser()" class="form form-horizontal" id="form-member-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="username" name="username">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>密码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="password" class="input-text" value="" placeholder="" id="password" name="password">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>确认密码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="password" class="input-text" value="" placeholder="" id="apassword" name="apassword">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>真实姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="realName" name="username">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">用户类别：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select class="select" name="" id="useTypeValue">
					<option value="">请选择用户类别</option>
					<option value="">医院管理员</option>
					<option value="">挂号收费员</option>
					<option value="">门诊医生</option>
					<option value="">医技医生</option>
					<option value="">药房操作员</option>
					<option value="">财务管理员</option>
				</select>
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">医生职称：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select class="select" name="" id="constantName">
					<option value="">请选择医生职称</option>
					<option value="">主任医师</option>
					<option value="">副主任医师</option>
					<option value="">主治医师</option>
					<option value="">住院医师</option>
			</select>
				</span> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>是否参与排班：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="scheduling" type="radio" id="sex-1" class="isScheduling">
					<label for="sex-1">是</label>
				</div>
				<div class="radio-box">
					<input name="scheduling" type="radio" id="sex-2" class="isScheduling">
					<label for="sex-2">否</label>
				</div>
				
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">所在科室：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select class="select" name="" id="deptName">
					<option value="">请选择所在科室</option>
					<option>心血管内科</option>
<option>神经内科</option>
<option>普通内科</option>
<option>消化内科</option>
<option>呼吸内科</option>
<option>内分泌科</option>
<option>肾病内科</option>
<option>血液内科</option>
<option>感染内科</option>
<option>老年病内</option>
<option>风湿免疫</option>
<option>透析科</option>
<option>变态反应科</option>
<option>普通外科</option>
<option>泌尿外科</option>
<option>神经外科</option>
<option>胸外科</option>
<option>整形外科</option>
<option>肛肠外科</option>
<option>肝胆外科</option>
<option>乳腺外科</option>
<option>心血管外</option>
<option>心脏外科</option>
<option>器官移植</option>
<option>微创外科></option>
<option>功能神经外科</option>
<option>腺体外科</option>
<option>儿科综合</option>
<option>小儿外科</option>
<option>儿童保健科</option>
<option>新生儿科</option>
<option>小儿骨科</option>
<option>小儿神经内科</option>
<option>小儿呼吸科</option>
<option>小儿血液科</option>
<option>小儿耳鼻喉科</option>
<option>小儿心内科</option>
<option>小儿康复科</option>
<option>小儿精神科</option>
<option>小儿肾内科</option>
<option>小儿消化科</option>
<option>小儿皮肤科</option>
<option>小儿急诊科</option>
<option>小儿内分泌科</option>
<option>小儿泌尿外科</option>
<option>小儿感染科</option>
<option>小儿心外科</option>
<option>小儿胸外科</option>
<option>小儿神经外科</option>
<option>小儿整形科</option>
<option>小儿风湿免疫科</option>
<option>小儿妇科</option>
<option>传染科</option>
<option>肝病科</option>
<option>艾滋病科</option>
<option>传染危重室</option>
<option>妇产科综合</option>
<option>妇科</option>
<option>产科</option>
<option>计划生育科</option>
<option>妇科内分泌</option>
<option>遗传咨询科</option>
<option>产前检查科</option>
<option>妇泌尿科</option>
<option>前列腺</option>
<option>性功能障碍</option>
<option>生殖器感染</option>
<option>男性不育</option>
<option>生殖整形</option>
<option>精神科</option>
<option>司法鉴定科</option>
<option>药物依赖科</option>
<option>中医精神科</option>
<option>双相障碍科</option>
<option>皮肤科</option>
<option>性病科</option>
<option>中医综合科</option>
<option>针灸科</option>
<option>中医骨科</option>
<option>中医妇产科</option>
<option>中医外科</option>
<option>中医儿科</option>
<option>中医肛肠科</option>
<option>中医皮肤科</option>
<option>中医五官科</option>
<option>中医按摩科</option>
<option>中医消化科</option>
<option>中医肿瘤科</option>
<option>中医心内科</option>
<option>中医神经内科</option>
<option>中医肾病内科</option>
<option>中医内分泌</option>
<option>中医呼吸科</option>
<option>中医肝病科</option>
<option>中医男科</option>
<option>中医风湿免疫内科</option>
<option>中医血液科</option>
<option>中医乳腺外科</option>
<option>中医老年病科</option>
<option>肿瘤综合科</option>
<option>肿瘤内科</option>
<option>放疗科</option>
<option>肿瘤外科</option>
<option>肿瘤妇科</option>
<option>骨肿瘤科</option>
<option>肿瘤康复科</option>
<option>骨外科</option>
<option>手外科</option>
<option>创伤骨科</option>
<option>脊柱外科</option>
<option>骨关节科</option>
<option>骨质疏松科</option>
<option>矫形骨科</option>
<option>耳鼻咽喉头颈科</option>
<option>口腔科</option>
<option>眼科</option>
<option>康复科</option>
<option>理疗科</option>
<option>麻醉科</option>
<option>疼痛科</option>
<option>营养科</option>
<option>高压氧科</option>
<option>功能检查科</option>
<option>病理科</option>
<option>检验科</option>
<option>实验中心</option>
<option>心电图科</option>
<option>放射科</option>
<option>超声诊断科</option>
<option>医学影像科</option>
<option>核医学科</option>
<option>药剂科</option>
<option>护理科</option>
<option>体检科</option>
<option>急诊科</option>
<option>公共卫生与预防科</option>
<option>设备科</option>
<option>财务科</option>
				</select>
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>挂号级别：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="registname" type="radio" id="sex-1" class="registName">
					<label for="sex-1">专家号</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="sex-2" class="registName" name="registname">
					<label for="sex-2">普通号</label>
				</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;确定&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">

//判断当表单失去焦点时,用户名是否为空
$("#username").blur(function(){
	
	if($(this).val()==null||$(this).val()==""){
		$(this).val('用户名不能为空').css("color","#B22222");
		
	}
})
//表单获取焦点时将文字颜色改为黑色
$("#username").focus(function(){	
		$(this).css("color","#010101");
})
//判断两次输入的密码一致
$("#apassword").blur(function(){
	   if($(this).val()!=""){
        		if($(this).val()!=$("#password").val()){
        			 alert("两次密码输入不一致,请重新输入!");
        		}
	   }
	   else{
		   alert("密码不能为空!");
	   }
        	})
        function checkUser(){
        	var flag=true;
            if($("#username").val()==""||($("#password").val()!=$("#apassword").val())){flag=false;}
            else{
        	var userName=$("#username").val();
        	var password=$("#apassword").val();
        	var realName=$("#realName").val();
        	var useTypeValue=$("#useTypeValue option:selected").text();
        	var useType=nameChangeId(useTypeValue);
        	var constantName=$("#constantName option:selected").text();
        	var docTitleId=null;
        	var isScheduling=$(".isScheduling:checked").nextAll().text();
        	var deptName=$("#deptName option:selected").text();
        	var deptId=null;
        	var registName=$(".registName:checked").nextAll().text();
        	var registLeId=null;
        	$.ajaxSettings.async=false;
        	$.post(
            		"/getIDByConstantName",
            		{"constantName":constantName},
            		function(res){
            			docTitleId=res;
            			$.post(
            				"/getIDByDeptName",
            				{"deptName":deptName},
            				function(res1){
            					deptId=res1;
            					console.log(deptId);
            					$.post(
            						"/getIDByRegistName",
            						{"registName":registName},
            						function(res2){
            							registLeId=res2;
            							console.log(isScheduling);
            							$.ajax({
            								url:"/insertUser",
            								data:{"userName":userName,"password":password,"realName":realName,"useType":useType,"docTitleId":docTitleId,"isScheduling":isScheduling,"deptId":deptId,"registLeId":registLeId},
            								type:"post"
            								
            							});
            						}
            					
            					);
            				}
            			);
            		}
            		
            		);
            }
        	return flag;
        }
        
        function nameChangeId(name){
        	var id=null;
        	switch(name)
            {
              case("医院管理员"): 
           	      id=1;
                  break;
              case("挂号收费员"):
            	  id=2;
                  break;
              case("门诊医生"):
            	  id=3;
           	      break;
              case("医技医生"):
            	  id=4;
           	      break;
              case("药房操作员"):
            	  id=5;
           	      break;
              case("财务管理员"):
            	  id=6;
           	      break;
              default:
           	      break;
            }
        	return id;
        }
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>